package com.link2room.ironhide.controller.api;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.ironhide.dto.param.base.RoomtypeBaseParamDto;
import com.link2room.ironhide.facade.IRoomtypeFacadeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * Created by sss on 2017/8/16.
 */
@Api(tags = "房型相关")
@RestController
@RequestMapping("/api/Rooms")
public class RoomtypeInfoApiController {
    @Resource
    private IRoomtypeFacadeService roomtypeFacadeService;

    @RequestMapping(value = "/Room",method= RequestMethod.GET)
    public BaseResultDto HotelBaseInfoList(
            HttpServletRequest httpServletRequest,
            @RequestParam(value = "lhotelCode" ,required = false) String lhotelCode,
            @RequestParam(value = "rmtype" ,required = false) String rmtype
    ) throws Exception {
        RoomtypeBaseParamDto roomtypeBaseParamDto=new RoomtypeBaseParamDto();
        roomtypeBaseParamDto.setLhotelCode(lhotelCode);
        roomtypeBaseParamDto.setRmtype(rmtype);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setResultInfo(roomtypeFacadeService.getRoomtypeDtoByRmtype(roomtypeBaseParamDto));
        return l2rRs;
    }
}
